﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IODataAccess;
using IOEntity;
namespace IOBusiness
{
    public class clsBSHinhAnh
    {
        clsDAHinhAnh obj = new clsDAHinhAnh();
        public clsHinhAnh GetById(int id)
        {
            try
            {
                return obj.GetById(id);
            }
            catch (Exception)
            {

                throw;
            }
            
        }
        public List<clsHinhAnh> GetByTour(int tourid)
        {
            try
            {
                return obj.GetByTour(tourid);
            }
            catch (Exception)
            {

                throw;
            }
            
        }
        public List<clsHinhAnh> GetByLoai(int loai)
        {
            try
            {
                return obj.GetByLoai(loai);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<clsHinhAnh> GetByLoaiTour(int loai,int tour)
        {
            try
            {
                if (tour>0)
                    return obj.GetByTour(tour);
                else
                    return obj.GetByLoai(loai);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public int Insert(clsHinhAnh obj)
        {
            try
            {
                return this.obj.Insert(obj);
            }
            catch (Exception)
            {

                throw;
            }
            
        }
        public void Update(clsHinhAnh obj)
        {
            try
            {
                this.obj.Update(obj);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void Delete(int id)
        {
            try
            {
                this.obj.Delete(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
